<include file="__THEME__/common/header" />
<script language="javascript">
$(function(){
	var editurl = '{:U("Product/edit")}';
	$('#datagrid').datagrid({
		columns:[[
				{field:'id',title:'ID',width:50},
				{field:'name',title:'产品名称',width:200},
				{field:'sn',title:'货号',width:120},
				{field:'price',title:'价格',width:100},
				{field:'stock_number',title:'库存',width:80},
				{field:'add_time',title:'添加时间',width:120},
				{field:'opt',title:'操作',width:180, formatter:function(v, r){
					return '<div class="opt"><a href="javascript:;" onclick="toProduct('+r.id+')" class="view">库存</a><a href="'+editurl+'&id='+r.id+'" class="edit">编辑</a><a href="javascript:;" onclick="doDelete('+r.id+')" class="delete">删除</a></div>';}}
			]]
	});
});
</script>
<div class="search-box">
产品搜索：
</div>
<div class="box">
<table id="datagrid" url="{:U('Product/plist')}" title="产品列表" pagination="true" width="100%" idField="id"></table>
</div>
<include file="__THEME__/common/footer" />